<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<%@ include file="/common/meta.jsp"%>
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/gt_grid.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/default/skinstyle.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/china/skinstyle.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/vista/skinstyle.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/mac/skinstyle.css"/>" />
		<script type="text/javascript" src="<s:url value="/grid/gt_msg_cn.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/grid/gt_grid_all.js"/>"></script>
	</head>
	
	<body style="margin: 0px; margin: 2px;">
	<s:form name="dForm" id="dForm" action="dwsbquery!query.do">
		<table width="100%" cellpadding="0" cellspacing="0" id="conTable" >
					<tr>
					    <td class="lefttop"></td>
					    <td width="%"  class="centertop"></td>
					    <td class="righttop"></td>
				    </tr>
					<tr>
						<td height="26" class="leftcenter">&nbsp;</td>
					    <td class="center" >
					    	查询条件：
					    	<s:select id="xlxtype" name="xlxtype" list="xlxtypes" cssStyle="width:150" listKey="dm" listValue="mc" onchange="changeDm(this.value)"/>
					    	<span id="jbdiv1" style="display:none">
					    		<s:select id="jbdm" name="jbdm" list="jbdms" cssStyle="width:200" listKey="dm" listValue="mc"  headerKey="" headerValue="--请选择季报--"/>
					    	</span>
					    	<span id="jbdiv2" style="display:none">
					    		<s:select id="jbdmlx" name="jbdmlx" list="jbdmlxs" cssStyle="width:200" listKey="dm" listValue="mc"  headerKey="" headerValue="--请选择机构性质--" />
					    	</span>
					    	<input type="button" id="queryBtn" class="but" value="查   询" id="b_sendmessage" onclick="doquery()">
					    	
					    </td>
					   	<td class="rightcenter"></td>
					</tr>	
				   <tr>
					    <td class="leftbot"></td>
					    <td class="centerbot"></td>
					    <td class="rightbot"></td>
				   </tr>
			</table>
			<div id="mygrid_container" style="width:100%;" ></div>
	</s:form>		
	</body>
	<script type="text/javascript">
	
		
	var APP_PATH = '<c:url value="/"/>';
	var grid_demo_id = "myGrid1";
	var dsOption = {
		fields :  [ {name : 'RCID'},
					{name : 'RCNAME'}, 
		   		    {name : 'SEX_MC'}, 
		   		    {name : 'NATION_MC'},
		   		    {name : 'JG_MC'},  
		   		    {name : 'ZJLB_MC'}, 
		   		    {name : 'ZJNO'}, 
		   		    {name : 'RCLB_MC'}, 
					{name : 'XL_MC'}, 
					{name : 'XW_MC'}, 
					{name : 'ZC_MC'}, 
					{name : 'ZW'}, 
					{name : 'WORKUNIT'}, 
					{name : 'ZGBM_MC'}, 
					{name : 'DWDQ_MC'}, 
					{name : 'XXZY_MC'}, 
					{name : 'CSZY_MC'}
					/*,
					{name : 'url' }
					*/
					]
	};

	var colsOption = [ 
	 {
		id : 'SBDM_MC',
		header : "季报名称",
		headAlign:"center",
		width : 180,
		align : "left"
	},{
		id : 'QYMC',
		header : "企业名称",
		headAlign:"center",
		width : 180,
		align : "left"
	}, {
		id : 'ZCZJ',
		header : "注册资金(万元)",
		width : 80,
		align : "center"
		
	}, {
		id : 'QYDJZCLX_MC',
		header : "企业登记注册类型",
		headAlign:"center",
		width : 200,
		align : "left"
	}, 
	 {
		id : 'HYLB',
		header : "行业类别",
		headAlign:"center",
		width : 200,
		align : "left"
	},{
		id : 'YFJGS',
		header : "研发机构数",
		headAlign:"center",
		width : 80,
		align : "center"
	}, {
		id : 'GXJSCPS',
		header : "高新技术产品数",
		headAlign:"center",
		width : 150,
		align : "left"
	}, {
		id : 'ZRQYZSR',
		header : "在孵企业总收入",
		headAlign:"center",
		align : "left"
	}
	/**
	, {
		id : 'URL',
		header : "详细",
		align : "center", 
		renderer : function(v){
			return '<a href="'+ APP_PATH +'/#" >详情</a>';
		}
	}
	*/
	 ];

	var gridOption = {
		id : grid_demo_id,
		skin : "vista",
		width : "100%",
		height : (getSize().h - 60) + "px",
		pageSize : 25,
		container : 'mygrid_container',
		showGridMenu : true,
		allowCustomSkin : true,
		allowFreeze : true,
		allowHide : true,
		allowGroup : true,
		stripeRows : true,
		toolbarContent : 'nav | goto | pagesize | reload | export xls | print | filter | state | info',
		pageSizeList : [ 25, 50, 100, 200, 500 ],
		lightOverRow : true,
		showIndexColumn : false,
		dataset : dsOption,
		columns : colsOption,
		remoteSort : false,
		remoteFilter : false,
		loadURL : APP_PATH + '/query!getList.do',
		exportURL : APP_PATH + '/query!exportList.do',
		exportFileName : "列表",
		autoLoad : false,
		showIndexColumn : true,
		parameters:{}
	};
	var mygrid = new Sigma.Grid(gridOption);
	Event.observe(window, "load", function() {
		mygrid.render();
	}, true);
	
	function doquery(){
		if($('jbdm').value =='' && $('jbdmlx').value == ''){
			alert('请选择相应的查询条件');
			return false;
		}
		document.forms[0].submit();
	}
	
	isDivJb($('xlxtype').value);
	function isDivJb(v){
		if(v == 1){
			$('jbdiv1').style.display='';
			$('jbdiv2').style.display='none';
		}else{
			$('jbdiv1').style.display='none';
			$('jbdiv2').style.display='';
		}
	}
	function changeDm(v){
		$('jbdmlx').value= '';
		$('jbdm').value = '';
		if(v == 1){
			$('jbdiv1').style.display='';
			$('jbdiv2').style.display='none';
		}else{
			$('jbdiv1').style.display='none';
			$('jbdiv2').style.display='';
		}
	}
	
	function dofilter(){
		mygrid.showDialog("filter");
	}
	</script>
</html>

